package com.debai.mapper;

import com.debai.pojo.Screen;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScreenMapper {
    @Insert("insert into screen_table(position_id,screen_position,size,user_id) values(#{positionId},#{screenPosition},#{size},#{userId})")
    int insert(Screen screen);

    @Select("select * from screen_table where position_id = #{positionId}")
    List<Screen> selectAll(int positionId);

    @Update("update screen_table set position_id = #{positionId},screen_position = #{screenPosition},size = #{size} where id = #{id}")
    int update(Screen screen);

    @Delete("delete from screen_table where id = #{id}")
    int delete(int id);

    @Select("select * from screen_table where screen_position=#{screenPosition}")
    Screen selectByName(String screenPosition);

    @Select("select * from screen_table where id=#{screenId}")
    Screen selectById(int screenId);
}
